Tables [dbo].[OpportunityType]
Properties
PropertyValue
Created10:31:30 AM Tuesday, March 02, 2010
Last Modified1:20:15 PM Thursday, February 23, 2012
Columns
NameData TypeMax Length (Bytes)Allow NullsDefault
Cluster Primary Key PK_OpportunityType: OpportunityTypeKeyOpportunityTypeKeyuniqueidentifier16
No
(newid())
OpportunityClassnvarchar(50)100
No
Namenvarchar(50)100
No
Descriptionnvarchar(200)400
Yes
Foreign Keys FK_OpportunityType_ActionPlan: [dbo].[ActionPlan].DefaultActionPlanKeyIndexes IX_OpportunityType_DefaultActionPlanKey: DefaultActionPlanKeyDefaultActionPlanKeyuniqueidentifier16
Yes
Indexes IX_OpportunityType_DefaultOwnerKey: DefaultOwnerKeyDefaultOwnerKeyuniqueidentifier16
Yes
DefaultStatusnvarchar(20)40
Yes
AllowCompetitorsFlagbit1
No
((0))
Foreign Keys FK_OpportunityType_UserMain_UpdatedBy: [dbo].[UserMain].UpdatedByUserKeyIndexes IX_OpportunityType_UpdatedByUserKey: UpdatedByUserKeyUpdatedByUserKeyuniqueidentifier16
No
UpdatedOndatetime8
No
Foreign Keys FK_OpportunityType_UserMain_CreatedBy: [dbo].[UserMain].CreatedByUserKeyIndexes IX_OpportunityType_CreatedByUserKey: CreatedByUserKeyCreatedByUserKeyuniqueidentifier16
No
CreatedOndatetime8
No
SystemEntityKeyuniqueidentifier16
No
Foreign Keys FK_OpportunityType_AccessMain: [dbo].[AccessMain].AccessKeyIndexes IX_OpportunityType_AccessKey: AccessKeyAccessKeyuniqueidentifier16
No
MarkedForDeleteOndatetime8
Yes
OwnerGroupTypeKeyuniqueidentifier16
No
ContactGroupTypeKeyuniqueidentifier16
No
OpportunityCreationGroupKeyuniqueidentifier16
Yes
Indexes Indexes
NameColumnsUnique
Cluster Primary Key PK_OpportunityType: OpportunityTypeKeyPK_OpportunityTypeOpportunityTypeKey
Yes
IX_OpportunityType_AccessKeyAccessKey
IX_OpportunityType_CreatedByUserKeyCreatedByUserKey
IX_OpportunityType_DefaultActionPlanKeyDefaultActionPlanKey
IX_OpportunityType_DefaultOwnerKeyDefaultOwnerKey
IX_OpportunityType_UpdatedByUserKeyUpdatedByUserKey
Foreign Keys Foreign Keys
NameColumns
FK_OpportunityType_AccessMainAccessKey->[dbo].[AccessMain].[AccessKey]
FK_OpportunityType_ActionPlanDefaultActionPlanKey->[dbo].[ActionPlan].[ActionPlanKey]
FK_OpportunityType_UserMain_CreatedByCreatedByUserKey->[dbo].[UserMain].[UserKey]
FK_OpportunityType_UserMain_UpdatedByUpdatedByUserKey->[dbo].[UserMain].[UserKey]
Permissions
TypeActionOwning Principal
GrantDeleteIMIS
GrantInsertIMIS
GrantReferencesIMIS
GrantSelectIMIS
GrantUpdateIMIS
SQL Script
CREATE TABLE [dbo].[OpportunityType]
(
[OpportunityTypeKey] [uniqueidentifier] NOT NULL CONSTRAINT [DF_OpportunityType_OpportunityTypeKey] DEFAULT (newid()),
[OpportunityClass] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Name] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Description] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[DefaultActionPlanKey] [uniqueidentifier] NULL,
[DefaultOwnerKey] [uniqueidentifier] NULL,
[DefaultStatus] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[AllowCompetitorsFlag] [bit] NOT NULL CONSTRAINT [DF_OpportunityType_AllowCompetitorsFlag] DEFAULT ((0)),
[UpdatedByUserKey] [uniqueidentifier] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[CreatedByUserKey] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[SystemEntityKey] [uniqueidentifier] NOT NULL,
[AccessKey] [uniqueidentifier] NOT NULL,
[MarkedForDeleteOn] [datetime] NULL,
[OwnerGroupTypeKey] [uniqueidentifier] NOT NULL,
[ContactGroupTypeKey] [uniqueidentifier] NOT NULL,
[OpportunityCreationGroupKey] [uniqueidentifier] NULL
) ON [PRIMARY]

GO
ALTER TABLE [dbo].[OpportunityType] ADD CONSTRAINT [PK_OpportunityType] PRIMARY KEY CLUSTERED ([OpportunityTypeKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_OpportunityType_AccessKey] ON [dbo].[OpportunityType] ([AccessKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_OpportunityType_CreatedByUserKey] ON [dbo].[OpportunityType] ([CreatedByUserKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_OpportunityType_DefaultActionPlanKey] ON [dbo].[OpportunityType] ([DefaultActionPlanKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_OpportunityType_DefaultOwnerKey] ON [dbo].[OpportunityType] ([DefaultOwnerKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_OpportunityType_UpdatedByUserKey] ON [dbo].[OpportunityType] ([UpdatedByUserKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OpportunityType] ADD CONSTRAINT [FK_OpportunityType_AccessMain] FOREIGN KEY ([AccessKey]) REFERENCES [dbo].[AccessMain] ([AccessKey])
GO
ALTER TABLE [dbo].[OpportunityType] ADD CONSTRAINT [FK_OpportunityType_ActionPlan] FOREIGN KEY ([DefaultActionPlanKey]) REFERENCES [dbo].[ActionPlan] ([ActionPlanKey])
GO
ALTER TABLE [dbo].[OpportunityType] ADD CONSTRAINT [FK_OpportunityType_UserMain_CreatedBy] FOREIGN KEY ([CreatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO
ALTER TABLE [dbo].[OpportunityType] ADD CONSTRAINT [FK_OpportunityType_UserMain_UpdatedBy] FOREIGN KEY ([UpdatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO
GRANT REFERENCES ON  [dbo].[OpportunityType] TO [IMIS]
GRANT SELECT ON  [dbo].[OpportunityType] TO [IMIS]
GRANT INSERT ON  [dbo].[OpportunityType] TO [IMIS]
GRANT DELETE ON  [dbo].[OpportunityType] TO [IMIS]
GRANT UPDATE ON  [dbo].[OpportunityType] TO [IMIS]
GO
Uses
Used By